package edu.sctu.zhangwang.month201505.day20150523.textA;

/**
 * Created by Administrator on 2015/5/24 0024.
 */
public class TextA {
    public void paiXu(int[] n){
        for (int i=0;i<n.length-1;i++){
            for (int  j=0;j<n.length-i-1;j++){
                if (n[j]>n[j+1]){
                    int temp = n[j];
                    n[j]=n[j+1];
                    n[j+1]=temp;
                }
                print(n);
            }
        }

    }
    public void print(int[] n){
        for (int i = 0;i<n.length;i++){
            System.out.print(n[i] + "\t\t");
        }
        System.out.println();
    }
}
